<extend name="Public:base" />

<block name="content">
<div class="table-responsive">
	<table class="table table-striped table-bordered table-hover search-form" id="nav-table">
	<thead>
		<th><input name="name" type="text" placeholder="输入配置名称" value="{:I('name')}" />


		<select name="config_group">
			<option value="">-选择分组-</option>
			<option <?php if(isset($get_group)&&($get_group=='site')){echo ' selected="selected"';} ?> value="site">site</option>
			<option <?php if(isset($get_group)&&($get_group=='image')){echo ' selected="selected"';} ?> value="image">image</option>
			<option <?php if(isset($get_group)&&($get_group=='smtp')){echo ' selected="selected"';} ?> value="smtp">smtp</option>
			<option <?php if(isset($get_group)&&($get_group=='other')){echo ' selected="selected"';} ?> value="other">other</option>
		</select>

		<a class="btn btn-primary btn-sm radius5" href="javascript:;" id="search" url="{:U('Config/index')}">查询</a>

		</th>
		</thead>
	</table>

</div>

<div class="marginT10 marginB10">
	<a href="{:U('Config/add')}" class="btn btn-primary btn-sm radius5">新增</a>
</div>

<div class="table-responsive">
	<table class="table table-striped table-bordered table-hover" id="mytable">
		<thead>
			<tr>
				<th>名称</th>
				<th>分组</th>
				<th>值</th>
				<th>描述</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
				<volist name="list" id="c" empty="$empty">
				<tr>
					<td>{$c.name}</td>
					<td>{$c.config_group}</td>
					<td>{$c.value}</td>
					<td>{$c.info}</td>
					<td>
						<a  class="btn btn-xs btn-info radius5" href='{:U("Config/edit",array("id"=>$c["id"]))}'>
							<!-- <i class="icon-edit bigger-120"></i> -->
							<i class="ace-icon fa">编辑</i>
						</a>
						<a class="delete btn btn-xs btn-danger radius5" href='{:U("Config/del",array("id"=>$c["id"]))}' >
							<!-- <i class="icon-trash bigger-120"></i> -->
							<i class="ace-icon fa">删除</i>
						</a>
					</td>
				</tr>
				</volist>

				<tr>
					<td colspan="20" class="page">{$page}</td>
				</tr>
		</tbody>

	</table>
</div>

</block>
<block name="javascript">
<script>
$(function(){

	$("#search").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });


});
</script>
</block>